package com.tecode.service.impl;

import com.tecode.bean.Admin;
import com.tecode.mapper.AdminMapper;
import com.tecode.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2019/4/2.
 */
@Service
public class AdminServiceImpl implements AdminService {

    @Autowired
    private AdminMapper adminMapper;
    @Override
    public Admin adminLogin(String adminname) {
        Admin admin=adminMapper.adminLogin(adminname);

        return admin;
    }

    @Override
    public List<Admin> getAdminAll() {
        return adminMapper.getAdminAll();
    }


    @Override
    public Integer adminadd(String adminName, String password, int adminRole) {
        Integer integer=adminMapper.adminadd(adminName,password,adminRole);
        return integer;
    }

    @Override
    public Admin adminSerch(int adminid) {
        return adminMapper.adminSerch(adminid);
    }

    @Override
    public Integer adminUpdate(String adminName, String password, int adminRole, int adminid) {
        Integer integer= adminMapper.adminUpdate(adminName,password,adminRole,adminid);
        return integer;
    }


    @Override
    public List<Admin> serchAll(String serch) {
        return adminMapper.serchAll(serch);
    }

    @Override
    public void freeze(int id) {
        adminMapper.freeze(id);
    }
    @Override
    public void freeze2(int id) {
        adminMapper.freeze2(id);
    }

    @Override
    public void deletAll(Integer[] list) {
        adminMapper.deletAll(list);
    }

    @Override
    public Integer updatePermission(int adminid, int adminRole, String adminName) {
        return adminMapper.updatePermission(adminid,adminName,adminRole);
    }

}
